/**
 * 角色模块API
 */

import axios from './request';

/**
 * 获取角色列表
 */
export const getList = () => axios.get('/roles/list');

/**
 * 获取教师角色
 * @param {*} id 教师ID
 * @returns 
 */
export const getTeacherRoles = id => axios.get('/roles/teacherRoles/' + id);

/**
 * 获取列表
 * @returns 
 */
export const GetList = () => axios.get('/roles/list');

/**
 * 添加角色
 * @param {*} role 要添加的角色信息
 * @returns 
 */
export const AddRole = role => axios.post('/roles/add', role);

/**
 * 修改角色
 * @param {*} role 要修改的角色信息
 * @returns 
 */
export const UpdateRole = role => axios.put('/roles/update', role);

/**
 * 删除角色
 * @param {*} id 要删除的角色ID
 * @returns 
 */
export const DeleteRole = id => axios.delete('/roles/delete/' + id);

/**
 * 添加菜单
 * @param {*} obj 
 * @returns 
 */
export const AddMenus = obj => axios.post('/roles/addmenus', obj);